From: Jonas Dreßler Date: Sun, 10 Apr 2022 16:47:25 +0000 (+0200) Subject: dnd: Handle dragActorSource getting destroyed X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~393^2^2~67 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=de08ec915fd3de1bfd6488f14e0c8f8ae7250701;p=gnome-shell.git dnd: Handle dragActorSource getting destroyed Part-of: --- diff --git a/js/ui/dnd.js b/js/ui/dnd.js index 125024204..63ce5a020 100644 --- a/js/ui/dnd.js +++ b/js/ui/dnd.js @@ -367,6 +367,10 @@ var _Draggable = class _Draggable extends Signals.EventEmitter { y = stageY - this._dragActor.height / 2; } this._dragActor.set_position(x, y); + + this._dragActorSourceDestroyId = this._dragActorSource.connect('destroy', () => { + this._dragActorSource = null; + }); } else { this._dragActorSource = this.actor; } @@ -799,6 +803,11 @@ var _Draggable = class _Draggable extends Signals.EventEmitter { this._dragOrigParent = null; } + if (this._dragActorSource) { + this._dragActorSource.disconnect(this._dragActorSourceDestroyId); + this._dragActorSource = null; + } + this._dragState = DragState.INIT; currentDraggable = null; }